<template>
  <div>
    <el-table
      v-loading="listLoading"
      :data="shareList"
      stripe
      border
      fit
      style="width: 100%; margin-top: 10px"
    >
      <el-table-column
        label="文件名称"
        width="300"
        align="center"
        prop="fileName"
      >
      </el-table-column>
      <el-table-column
        label="创建时间"
        width="200"
        align="center"
        prop="createTime"
      >
      </el-table-column>
      <el-table-column
        label="过期时间"
        width="200"
        align="center"
        prop="outTime"
      >
      </el-table-column>
      <el-table-column label="提取码" width="200" align="center" prop="code">
      </el-table-column>
      <el-table-column label="状态" width="200" align="center">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.status"
            active-color="#13ce66"
            inactive-color="#ff4949"
            :active-value="0"
            :inactive-value="1"
            @change="changeStatus(scope.row)"
          >
          </el-switch>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

import share from "@/api/system/share";
export default {
  data() {
    return {
      value:true,
      listLoading: false,
      shareList: [],
    };
  },
  methods: {
    changeStatus(row) {
      share.status(row.urlId,row.status).then(res=>{
        console.log(res);
      })
    },
    getShareList() {
      share.getShareList().then((res) => {
        this.shareList = res.data;
      });
    },
  },
  created() {
    this.getShareList();
  },
};
</script>

<style>
</style>